namespace KPIS.GERP.Models.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class update0073 : DbMigration
    {
        public override void Up()
        {
            DropForeignKey("dbo.SysTaskHistory", "FromTaskId", "dbo.SysTask");
            DropForeignKey("dbo.SysTaskHistory", "ToTaskId", "dbo.SysTask");
            DropIndex("dbo.SysTaskHistory", new[] { "FromTaskId" });
            DropIndex("dbo.SysTaskHistory", new[] { "ToTaskId" });
            AddColumn("dbo.SysTaskHistory", "PassStep", c => c.Boolean(nullable: false));
            AddColumn("dbo.SysTaskHistory", "ResultStep", c => c.String());
            AddForeignKey("dbo.SysTaskHistory", "FromTaskId", "dbo.SysTaskHistory", "TaskHistoryId");
            CreateIndex("dbo.SysTaskHistory", "FromTaskId");
            DropColumn("dbo.SysTaskHistory", "ToTaskId");
        }
        
        public override void Down()
        {
            AddColumn("dbo.SysTaskHistory", "ToTaskId", c => c.Int());
            DropIndex("dbo.SysTaskHistory", new[] { "FromTaskId" });
            DropForeignKey("dbo.SysTaskHistory", "FromTaskId", "dbo.SysTaskHistory");
            DropColumn("dbo.SysTaskHistory", "ResultStep");
            DropColumn("dbo.SysTaskHistory", "PassStep");
            CreateIndex("dbo.SysTaskHistory", "ToTaskId");
            CreateIndex("dbo.SysTaskHistory", "FromTaskId");
            AddForeignKey("dbo.SysTaskHistory", "ToTaskId", "dbo.SysTask", "TaskId");
            AddForeignKey("dbo.SysTaskHistory", "FromTaskId", "dbo.SysTask", "TaskId");
        }
    }
}
